<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0" 
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" 
        xmlns="http://www.w3.org/1999/xhtml">
    <xsl:output method="xml" indent="yes"
        doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" 
        doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
    <xsl:include href="../style/theme.xsl" />
    
    <xsl:template match="content">
	<xsl:apply-templates select="data" />
    </xsl:template>
    
    <xsl:template match="content/data">
		<table border="0" width="100%" cellpadding="0" cellspacing="0">
			<tr>
				<td>
					<xsl:apply-templates select="show" />
					<xsl:apply-templates select="edit" />
					<xsl:apply-templates select="error" />
				</td>
			</tr>
			<tr align="bottom" height="100px">
				<td>
					<table width="100%" cellpadding="0" cellspacing="2">
						<tr valign="top">
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;" >
								<img class="logo" src="/image/groups-logo.png" width="30px" alt="" />
								<p>Группы пользователя:&#160;</p>
								<ul>
									<xsl:for-each select="groups/item">
											<li><a href="{@href}"><xsl:value-of select="@title"/></a></li>
									</xsl:for-each>
								</ul>
								<xsl:value-of select="@title"/>
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<p>Тексты пользователя</p>
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<img class="logo" src="/image/music-logo.png" width="30px" alt="" />
								<p>Музыка пользователя:&#160;</p>
								<ul>
									<xsl:for-each select="music/item">
											<li><a href="{@href}"><xsl:value-of select="@title"/></a></li>
									</xsl:for-each>
									<xsl:apply-templates select="music/more-music" />
								</ul>
							
							</td>
							<td style="background: #fff url('../boxbg.jpg') repeat-x top; border: 1px solid #ccc;">
								<img class="logo" src="/image/video-logo.png" width="30px" alt="" />
								<p>Видео пользователя</p>
								<ul>
									<xsl:for-each select="video/item">
											<li><a href="{@href}"><xsl:value-of select="@title"/></a></li>
									</xsl:for-each>
									<xsl:apply-templates select="video/more-video" />
								</ul>
							</td>
						</tr>
				
					</table>
				</td>
			</tr>
		</table>
		</xsl:template>
		
		<xsl:template match="show">
		<img class="right" src="{ava}" width="150px" alt="" />
			<div stile="display: block;" >
				<xsl:apply-templates select="online" />
			</div>
			<h1><xsl:value-of select="name"/></h1>
			<script type="text/javascript" src="/js/username.js"></script>
			<script type="text/javascript" src="/js/core.js"></script>
			<!--<script type="text/javascript">
			<xsl:text disable-output-escaping="yes">
			var stat;
			stat = "sos at work ";

			//stat_edit();onkeypress

			document.write('&lt;a href="#" onclick="open_edit_stat(\'visible\');" alt="Редактировать статус" >'+stat+'&lt;/a>');
			document.write('&lt;input id="status" style="visibility:hidden" onkeyup="stat_edit()" type="text" size="20" maxlength="100" name="stat" value="' + stat + '&#160;"  />');
			
			</xsl:text>
			</script>-->
			<!--/form-->
			<a href="#" onclick="open_edit_stat('visible');" alt="Редактировать статус" ><xsl:value-of select="stat"/></a>
			<input id="status" style="visibility:hidden" onkeyup="stat_edit()" type="text" size="20" maxlength="100" name="stat" value="{stat}&#160;"  />
			
			<div class="basicinfo">
				<table border="0" class="basic" cellpadding="0" cellspacing="0">
					<tr>
						<td class="td1">Пол:&#160;</td>
						<td class="td2">
							<div class="dataZnach"><xsl:value-of select="sex"/></div>
						</td>
					</tr>
					<tr>
						<td class="td1">День&#160;рождения:&#160;</td>
						<td class="td2"><xsl:value-of select="bdate"/>,&#160;<xsl:value-of select="age"/>&#160;лет</td>
					</tr>
					<tr>
						<td>
							<h2>Информация</h2>
						</td>
					</tr>
					<tr>
						<td>
							<h3>Контакты</h3>
						</td>
					</tr>
					<tr>
						<td class="td1">Телефоны:&#160;</td>
						<td>
							<div class="dataZnach">
								<xsl:for-each select="phone/item">
									<div name="{@type}" style="{@style}">
										<img src="{@img}" width="12px"/>:&#160;+<xsl:value-of select="@country"/>(<xsl:value-of select="@city"/>) <xsl:value-of select="@number"/><br />
									</div>
								</xsl:for-each>
						
							</div>
						</td>
					</tr>
					<tr>
						<td class="td1">В&#160;сети:&#160;</td>
						<td class="td2">
							<div class="dataZnach">
								<xsl:for-each select="im/item">
										<img src="/image/im/{@type}.png" height="16px" />: <xsl:value-of select="@data"/><br />
								</xsl:for-each>
							</div>
						</td>
					</tr>
					<tr>
						<td>
							<h3>Дополнительно</h3>
						</td>
					</tr>
						
					<tr>
						<td class="td1">Интересы:&#160;</td>
						<td class="td2">
							<div class="dataZnach"><xsl:value-of select="inters"/></div>
						</td>
					</tr>
					<tr>
						<td class="td1">Цитата:&#160;</td>
						<td class="td2">
							<div class="dataZnach"><xsl:value-of select="citata"/></div>
						</td>
					</tr>
					<tr>
						<td class="td1">&#160;себе:&#160;</td>
						<td class="td2">
							<div class="dataZnach"><xsl:value-of select="about"/></div>
						</td>
					</tr>
				</table>	
			</div><!-- personal -->
			<!-- часть контента контента начало розыска -->
		</xsl:template>
		<xsl:template match="edit">
			<script type="text/javascript" src="/js/username.js"></script>
			<script type="text/javascript" src="/js/core.js"></script>
			<script type="text/javascript">
			<xsl:text disable-output-escaping="yes">
			
			function change_phone()
			{
				phone_arr();
				user_info_edit('phone');
			}
			
			</xsl:text>
			</script>
			
			<img class="right" src="{ava}" width="150px" alt="" />
			<h1>Редактирование анкеты</h1>
			<h2><span style="color:red;">Приносим свои извинения: временно не работают пункты отмеченные (*)</span></h2>
			<p>Здесь Вы можете изменить информацию о себе. Будьте внимательны при заполнение.</p>
			
			<div class="basicinfo">
				<table border="0" class="basic" cellpadding="0" cellspacing="0">
					<tr>
						<td class="td1">Логин:</td>
						<td><input disabled="disabled" type="text" size="20" maxlength="100" id="nic" name="nic" value="{/document/user/@nic}" /></td>
					
					</tr>
					<tr>
						<td class="td1"><span class="imp">*</span>Пароль:</td>
						<td><input type="password" size="20" maxlength="100" name="pass1" id="pass1" value="*****" /></td>

					
					</tr>
					<tr>
						<td class="td1"><span class="imp">*</span>Повторите пароль:</td>
						<td><input type="password" onkeyup="check_pass_value();" size="20" maxlength="100" id="pass2" value="*****" /></td>
					</tr>

					<tr>
					<td>&#160;</td>
					<td colspan="2">&#160;</td>
					</tr>

					<tr>
						<td class="td1">E-mail:</td>
						<td colspan="2"><input type="text" disabled="disabled" size="25" maxlength="100" name="mail" value="{email}" id="mail" /></td>
					</tr>
					<tr>
						<td colspan="3" class="td1">ФИО:</td>
						<td><input type="text" onkeyup="user_info_edit('name');" size="45" maxlength="100" name="name" value="{name}" id="name" /></td>
					
						<td><label id="name_message">&#160;</label></td>
					</tr>
					<!--C полом отдельная песня!!!-->
					<tr>
						<td colspan="3" class="td1">Пол:</td>
						<td ><span style="color: red">♀</span><input onchange="change_sex();" type="radio" name="sex" value="0" id="sex0"/><span style="color: blue">♂</span><input onchange="change_sex();" type="radio" name="sex" value="1" id="sex1"/>
						<label id="sex_message">&#160;</label>
						</td>
					
						<!--<td width="250px"><label id="sex_message">&#160;</label></td>-->
					</tr>

					<tr>
						<td class="td1"><span class="imp">*</span>Дата рождения:</td>
						<td colspan="2"><input type="text" size="2" maxlength="2" name="bday" value="{bdate/@bday}" id="bday" />-<input type="text" size="2" maxlength="2" name="bmonth" value="{bdate/@bmonth}" id="bmonth" />-<input type="text" size="4" maxlength="4" name="byear" value="{bdate/@byear}" id="byear" /><span style="color: #9C9C9C">дд-мм-гггг</span></td>
					</tr>
					<tr>
						<td class="td1">Телефоны:</td>
						<td colspan="2">
							<div name="phone-type-select">
								Добавить:
								<div style="display: inline; font-size: 0.8em;">
								<a onclick="phone_add('mob');"><img src="/image/phone/phone_mob.png" width="10px" title="Мобильный"/>&#160;Мобильный</a>,
								<a onclick="phone_add('home');"><img src="/image/phone/phone_home.png" width="12px" title="Домашний"/>&#160;Домашний</a>,
								<a onclick="phone_add('work');"><img src="/image/phone/phone_work.png" width="12px" title="Рабочий"/>&#160;Рабочий</a>,
								<a onclick="phone_add('other');"><img src="/image/phone/phone_other.png" width="12px" title="Другой"/>&#160;Другой</a>.
								</div>
								<!--<input type="button" onclick="phone_add();" id="phone-add-button" width="8px" value="добавить" />-->
							</div>
							<div id="phone-add-div" name="put">
								<xsl:for-each select="phone/item">
										<div name="{@type}" style="{@style}">
											<img src="{@img}" width="12px" title="Мобильный"/>:&#160;+<input type="text" size="2" maxlength="4" name="phone_country_{@type_short}" id="phone_country{@type_short}" value="{@country}" />(<input type="text" size="5" maxlength="5" name="phone_city_{@type_short}" id="phone_city_{@type_short}" value="{@city}" />)<input type="text" size="7" maxlength="7" name="phone_number_{@type_short}" id="phone_number_{@type_short}" value="{@number}" /><span class="imp" title="Удалить" onclick="phone_add('{@type_short}');">X</span>
										</div>
								</xsl:for-each>
							</div>
							<div id="null" style="display:none">
									<textarea id="phone" name="phone"></textarea>
								</div>
							<input type="button" name="phone_add" onclick="change_phone();" id="phone_add" value="Сохранить" />
							<label id="phone_message">&#160;</label>
						</td>
					</tr>
					<tr>
						<td class="td1"><span class="imp">*</span>IM:</td>
						<td colspan="2">
							<xsl:for-each select="im/item">
								<img src="/image/im/{@type}.png" height="16px" />: <input type="text" size="20" maxlength="100" name="im_{@type}" id="icq" value="{@data}"/><br />
							</xsl:for-each>
							<input type="button" name="im_add" id="im_add" value="еще..." />
						</td>
					</tr>
					<tr>
						<td colspan="3" class="td1">О себе:</td>
						<td ><textarea cols="35" onkeyup="user_info_edit('about');" rows="5" name="about" id="about" ><xsl:value-of select="about"/></textarea>
						</td>
					
						<td><label id="about_message">&#160;</label></td>
					</tr>
					<tr>
						<td colspan="3" class="td1">Интересы:</td>
						<td><textarea cols="35" onkeyup="user_info_edit('inters');" rows="5" name="interes" id="interes"><xsl:value-of select="inters"/></textarea></td>
					
						<td><label id="inters_message">&#160;</label></td>
					</tr>
					<tr>
						<td colspan="3" class="td1">Цитаты:</td>
						<td ><textarea cols="35" onkeyup="user_info_edit('citata');" rows="5" name="citata" id="citata"><xsl:value-of select="citata"/></textarea></td>
					
						<td><label id="citata_message">&#160;</label></td>
					</tr>
					<tr>
						<td class="td1"><span class="imp">*</span>Фотография: </td>
						<td colspan="2"><input type="file" name="filename" id="file" /></td>
					</tr>
				</table>
			</div>
		</xsl:template>
		
		<xsl:template match="error">
			<h1><xsl:value-of select="text"/></h1>
		</xsl:template>
		
		<xsl:template match="online">
			[Online]
		</xsl:template>
		
		<xsl:template match="more-music">
			<li>
				<a href="http://xepec.ru/music/index.pl?uname={@user_id}&amp;act=playlist">ещё...</a>
			</li>
		</xsl:template>
		
		<xsl:template match="more-video">
			<li>
				<a href="http://xepec.ru/video/index.pl?uname={@user_id}&amp;act=videolist">ещё...</a>
			</li>
		</xsl:template>
		

	
</xsl:stylesheet>
